﻿$(function () {
    $("#buttonlogin").click(function () {
        var postdata = "nickname=" + $.trim($("#nickname").val())
            + "&password=" + $.trim($("#password").val());
        $.post("/user/userLogin", postdata, function (data) {
            if (data.code == 200) {
                alert("登陆成功");
                window.location.href="/index";
            } else {
                alert("用户名或密码错误");
            }
        }, "json");
    });
});
